package com.cskaoyan.order.api;

import com.cskaoyan.mall.commons.result.ServiceCallResponse;
import com.cskaoyan.mall.commons.result.ServiceCallResponseUtil;
import com.cskaoyan.order.constant.OrderConstants;
import com.cskaoyan.order.service.OrderCoreService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * @ClassName PayApiImpl
 * @Description TODO
 * @Author XiaoWJ
 * @Date 2022/9/25 22:18
 **/
@RestController
public class PayApiImpl {

    @Autowired
    OrderCoreService orderCoreService;

    @PutMapping(value = "/rpc/pay/success")
    public ServiceCallResponse payOrderSuccess(@RequestParam("orderId") String orderId) {

        orderCoreService.updateOrder(OrderConstants.ORDER_STATUS_PAYED ,orderId);

        return new ServiceCallResponseUtil<>().ok(null);


    }



}
